//Created by daminghu-cli yasenagat# on 2020-05-08 16:28:01
import http from "@/api/http"
import {Message} from 'element-ui';

export const api_login = data => http('/user/login', data, 'POST');


export function isResultOk(response) {
    if (response) {
        if (response.code == 0) {
            Message.info({message: '操作成功'})
            return true
        } else {
            Message.error({message: '操作失败'})
            return false
        }
        // else if (response.result == -10) {
        //     router.push("/")
        // }
    } else {
        Message.error({message: '操作失败'})
        return false
    }

}

export const api_agent_svr_tree = data => http('/agent/agentsvrtree', data);
export const api_readmany_tb_agent = data => http('/agent/agentlist', data);
export const api_readcount_tb_agent = data => http('/agent/agentcount', data);
export const api_deleteone_tb_agent = data => http('/tb-agent/deleteone', data);
export const api_updateone_tb_agent = data => http('/tb-agent/updateone', data, 'POST');
export const api_updatexxx_tb_agent = data => http('/tb-agent/updatexxx', data, 'POST');
export const api_createone_tb_agent = data => http('/tb-agent/createone', data, 'POST');


export const api_readmany_tb_agent_task = data => http('/agent/agenttasklist', data);
export const api_readcount_tb_agent_task = data => http('/agent/agenttaskcount', data);
export const api_deleteone_tb_agent_task = data => http('/tb-agent-task/deleteone', data);
export const api_updateone_tb_agent_task = data => http('/tb-agent-task/updateone', data, 'POST');
export const api_updatexxx_tb_agent_task = data => http('/tb-agent-task/updatexxx', data, 'POST');
export const api_createone_tb_agent_task = data => http('/tb-agent-task/createone', data, 'POST');


export const api_readmany_tb_svr = data => http('/svr/svrlist', data);
export const api_readcount_tb_svr = data => http('/svr/svrcount', data);
export const api_deleteone_tb_svr = data => http('/tb-svr/deleteone', data);
export const api_updateone_tb_svr = data => http('/tb-svr/updateone', data, 'POST');
export const api_updatexxx_tb_svr = data => http('/tb-svr/updatexxx', data, 'POST');
export const api_createone_tb_svr = data => http('/tb-svr/createone', data, 'POST');


export const api_readmany_tb_svr_task = data => http('/svr/svrtasklist', data);
export const api_readcount_tb_svr_task = data => http('/svr/svrtaskcount', data);
export const api_deleteone_tb_svr_task = data => http('/tb-svr-task/deleteone', data);
export const api_updateone_tb_svr_task = data => http('/tb-svr-task/updateone', data, 'POST');
export const api_updatexxx_tb_svr_task = data => http('/tb-svr-task/updatexxx', data, 'POST');
export const api_createone_tb_svr_task = data => http('/tb-svr-task/createone', data, 'POST');




